<template>
	<view>
		<view class="mine-bg">
			<view class="topbg">
				<view class="top-box">
					<view class="avatar">
						<image :src="userInfo.avatar" mode=""></image>
					</view>
					<view>
						<view class="nickname">
							<text>{{userInfo.nickname}}</text>
						</view>
						<view class="m-flex">
							<view class="mine-grade">
								<text>白丁</text>
							</view>
							<view class="expense">
								消费
								<text>0</text>
								颗
							</view>
						</view>
					</view>
				</view>
				<view class="top-info ">
					<view>
						<view class="count-unit">
							<text class="count">{{userInfo.balance}}</text>颗
						</view>
						<view class="Wallet">我的钱包</view>
					</view>
					<view class="">
						<view class="count">
							<text>0</text>
						</view>
						<view class="follow">我的关注</view>
					</view>
				</view>
				<view class="level-progress">
					<view class="grade-name">
						<view class="mine-gradestrip">
							<text class="">白丁</text>
						</view>
						<view class="mine-gradestrip">
							<text>秀才</text>
						</view>
					</view>
					<view class="progress"></view>
					<view class="grade-degree">
						<view class="expense-number">
							0<text>颗</text>
						</view>
						<view class="upgrade">
							再消费
							<text>100</text>
							颗即可升级
						</view>
						<view class="expense-number">
							100<text>颗</text>
						</view>
					</view>
				</view>				
			</view>
			
			<view class="outside top-margin">
				<view class="order-status">
					<navigator url="/pages/order/order" class="modular">
						<view class="state-img">
							<image src="../../static/img/dingdan.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>全部订单</text>
						</view>
					</navigator>
					<navigator url="" class="modular">
						<view class="state-img">
							<image src="../../static/img/daifuwu.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>待服务</text>
						</view>
					</navigator>
					<navigator url="" class="modular">
						<view class="state-img">
							<image src="../../static/img/fuwuzhong.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>服务中</text>
						</view>
					</navigator>
					<navigator url="" class="modular">
						<view class="state-img">
							<image src="../../static/img/yiwancheng.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>已完成</text>
						</view>
					</navigator>
				</view>
			</view>
			
			<view class="outside function">
				<view class="order-status">
					<navigator url="/pages/mine/clerk/clerk" class="modular">
						<view class="state-img">
							<image src="../../static/img/cwdy.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>成为店员</text>
						</view>
					</navigator>
					<navigator url="/pages/mine/guard/guard" class="modular">
						<view class="state-img">
							<image src="../../static/img/wdsh.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>我的守护</text>
						</view>
					</navigator>
					<navigator url="/pages/mine/distribution/distribution" class="modular">
						<view class="state-img">
							<image src="../../static/img/fxzx.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>分销中心</text>
						</view>
					</navigator>
					<navigator url="/pages/mine/message-board/message-board" class="modular">
						<view class="state-img">
							<image src="../../static/img/lyb.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>留言板</text>
						</view>
					</navigator>
					<view class="modular" @click="show()">
						<view class="state-img">
							<image src="../../static/img/hztg.png" mode=""></image>
						</view>
						<view class="state-name">
							<text>合作推广</text>
						</view>
					</view>
					<!-- 弹窗开始 -->
					<view >
						<popup custom-class="demo-popup" position="center" v-model="visible">
							<view class="pop-up">
								
							</view>					
						</popup>
					</view>
					<!-- 弹窗结束 -->
				</view>
			</view>
			<view class="outside cell-wrap">
				<view class="cell">
					<navigator url="/pages/mine/grade-explain/grade-explain" class="cell-item">
						<view class="cell-left">
							<view class="state-img">
								<image src="../../static/img/djsm.png" mode=""></image>
							</view>
							<view class="cell-title">
								等级说明
							</view>
						</view>					
						<view class="arrow">
							<image src="../../static/ico/arrow.png" mode=""></image>
						</view>
					</navigator>				
				</view>
				<view class="cell">
					<navigator url="" class="cell-item">
						<view class="cell-left">
							<view class="state-img">
								<image src="../../static/img/yhxy.png" mode=""></image>
							</view>
							<view class="cell-title">
								用户协议
							</view>
						</view>					
						<view class="arrow">
							<image src="../../static/ico/arrow.png" mode=""></image>
						</view>
					</navigator>				
				</view>
				<view class="cell">
					<view class="cell-item">
						<view class="cell-left">
							<view class="state-img">
								<image src="../../static/img/ycgrdj.png" mode=""></image>
							</view>
							<view class="">
								<view class="cell-title">
									隐藏个人等级
								</view>
								<view class="cell-subtitle">
									下单时对店员隐藏您的个人等级
								</view>
							</view>							
						</view>					
						<view>
							<switch @change="switch2Change" color="#2979FF"/>
						</view>	
					</view>				
				</view>
				<view class="cell">
					<view class="cell-item">
						<view class="cell-left">
							<view class="state-img">
								<image src="../../static/img/yhxy.png" mode=""></image>
							</view>
							<view class="cell-title">
								清除缓存
							</view>
						</view>					
						<view class="arrow">
							<image src="../../static/ico/arrow.png" mode=""></image>
						</view>
					</view>				
				</view>				
			</view>

			
		</view>
	</view>
</template>

<script>
	import popup from '../../components/s-popup/index.vue'
	export default {
		components:{
			popup
		},
		data() {
			return {
				userInfo:[],
				visible: false,
			}
		},
		async onLoad() {
			await this.$onLaunched
			this.userInfo=getApp().globalData.userInfo;
		},
		methods: {			
			show(){
				this.visible = true;
			}
		}
	}

</script>

<style>
	.topbg {
		height: 650rpx;
		padding: 8rpx 26rpx;
		background:url(../../static/ico/minebg.png);
		background-size: 100% 100%;

	}
	.mine-bg{
		background-color: #F4F4F4;
		padding-bottom: 40rpx;
	}
	.top-box {
		display: flex;
		align-items: center;
		margin: 16rpx 8rpx;
		padding: 20rpx;
	}

	.avatar {
		width: 120rpx;
		/* height: 100rpx; */
		margin-right: 20rpx;

	}

	.avatar image {
		width: 120rpx;
		height: 120rpx;
		border-radius: 50%;
	}

	.nickname {
		font-size: 40rpx;
		margin-bottom: 15rpx;
	}

	.m-flex {
		display: flex;
		align-items: center;
	}

	.mine-grade {
		background-color: #de848c;
		padding: 1rpx 20rpx;
		border-radius: 180rpx;
		line-height: 40rpx;
		margin-right: 10rpx;
	}

	.mine-grade text {
		color: #fff;
		font-size: 30rpx;
		/* line-height: 45rpx; */
	}

	.expense {
		font-size: 34rpx;
	}

	.expense text {
		color: #FF3251;
	}

	.top-info {
		display: flex;
		justify-content: space-between;
		margin: 0 84rpx;
	}

	.count-unit {
		font-size: 20rpx;
		text-align: center;
	}

	.count {
		font-size: 40rpx;
		text-align: center;

	}

	.Wallet,
	.follow {
		margin-top: 20rpx;
		font-size: 30rpx;
	}

	.level-progress {
		margin: 16rpx 8rpx;
		padding: 20rpx;
	}

	.grade-name {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.mine-gradestrip{
		background-color: #de848c;
		padding: 0rpx 20rpx;
		border-radius: 180rpx;	
		margin-right: 10rpx;
		line-height: 40rpx;
	}
	.mine-gradestrip text{
		font-size: 27rpx;
		color: #FFFFFF;
		
	}

	.progress {
		height: 20rpx;
		background-color: #ECECEC;
		border-radius: 30px;
		margin: 16rpx 0;
	}

	.grade-degree {
		display: flex;
		justify-content: space-between;
	}

	.expense-number {
		font-size: 32rpx;
	}

	.upgrade {
		color: #ffffff;
		font-size: 28rpx;
	}

	.outside {
		/* background-color: #ffffff; */
		background-color: #fff;
		border-radius: 24rpx;
		/* width: 292px; */
		/* margin: -46px 13px 8px; */
		padding: 40rpx 50rpx 0;
		box-shadow: 0 0 1rpx rgba(225, 216, 208, .5);

	}
	.top-margin{
		margin: -140rpx 26rpx 41rpx;
	}    
	.function {
		margin: 40rpx 26rpx;
	}

	.modular {
		width: 25%;
		margin-bottom: 40rpx;
	}

	.order-status {
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
	}

	.state-img {
		width: 60rpx;
		height: 60rpx;
		margin: 0 auto;

	}

	.state-img image {
		width: 100%;
		height: 100%;
	}

	.state-name {
		margin-top: 20rpx;
		text-align: center;
	}
	.state-name text{
		font-size: 31rpx;
	}
	/* 合作推广 弹窗 开始 */
	.pop-up{
		width: 540rpx;
		height: 500rpx;
	}
	/* 合作推广 弹窗 结束 */
	.cell-wrap{
		padding: 0 30rpx;
		margin: 0 26rpx;
		/* border-bottom: 3px solid #F4F4F4; */
	}
	.cell{
		padding: 40rpx 30rpx;
		border-bottom: 8rpx solid #F4F4F4;
	}
	.cell-item {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.cell-left{
		display: flex;
		align-items: center;
		
	}
	.cell-title{
		margin-left: 20rpx;
		font-size: 31rpx;
	}
	.cell-subtitle{
		font-size: 28rpx;
		color: #909399;
		margin-left: 20rpx;
		margin-top: 10rpx;
	}
	.arrow {
		width: 30rpx;
		height: 30rpx;
	}
	
	.arrow image {
		width: 100%;
		height: 100%;
	}
</style>
